-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade version of APIM SDK #4603
Open
theunrepentantgeek
wants to merge
7
commits into
main
Choose a base branch
from
fix/apim-deletion
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
308b5c0
Update SDK version for APIManagement
theunrepentantgeek c34516a
Rename and update test
theunrepentantgeek 49bb769
Rename and update test
theunrepentantgeek 95bc523
Add testing docs
theunrepentantgeek d7134fa
Update v2/samples/apimanagement/v1api20230501preview/README.md
theunrepentantgeek 1ccd82e
Avoid attempts to load samples from non-yaml files
theunrepentantgeek 0f02ad6
Update asoctl go.mod/sum files
theunrepentantgeek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
3,590 changes: 2,087 additions & 1,503 deletions
3,590
v2/internal/controllers/recordings/Test_ApiManagement_20220801_CRUD.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
2,576 changes: 1,396 additions & 1,180 deletions
2,576
v2/internal/controllers/recordings/Test_ApiManagement_20230501preview_CRUD.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Test Tips | ||
|
||
API Management Services are soft-deleted by default, which can make running tests difficult. | ||
|
||
Before you can do a clean run of a test, you need to ensure any soft-deleted debris from prior test runs has been purged. | ||
|
||
To purge a soft-deleted service, you have to use **az** - as of Dec 2024, it cannot be done via the Azure portal. | ||
|
||
## Checking for soft-deleted services | ||
|
||
### Using az apim | ||
|
||
List all known soft-deleted services. | ||
|
||
```bash | ||
$ az apim deletedservice list --query "[].[name, location]" | ||
[ | ||
[ | ||
"asotest-apimsvcv2-yovquu", | ||
"East US 2" | ||
], | ||
[ | ||
"asotest-apimanagementv2-yovquu", | ||
"East US" | ||
], | ||
[ | ||
"asotestqpewjd", | ||
"East US" | ||
], | ||
[ | ||
"asotest-apimanagementv2-twykac", | ||
"East US" | ||
] | ||
] | ||
``` | ||
|
||
### Using az rest | ||
|
||
If you get an error from `az apim deletedservice list`, an alternative is to use their REST API directly. Fortunately, **az** lets you do this too | ||
|
||
``` bash | ||
az rest --method get --url https://management.azure.com/subscriptions/{subscription}/providers/Microsoft.ApiManagement/deletedservices?api-version=2021-08-01 | ||
``` | ||
|
||
## Purging soft-deleted services | ||
|
||
### Using az apim | ||
|
||
You need to specify both the service name and location. | ||
|
||
```bash | ||
az apim deletedservice purge --service-name "asotestqpewjd" --location "eastus" | ||
``` | ||
|
||
Deletion is slow - it can take a few minutes for az to return. After that, give it another 10m or so before rerunning your test. | ||
|
||
For more information, see https://andrewilson.co.uk/post/2022/09/apim-purge-soft-deleted-instance/ | ||
|
||
### Using az rest | ||
|
||
Similarly, you can use **az** to purge a selected instance via the REST API. Fill in `{subscription}`, `{location}` asd `{service-name}` and run this command: | ||
|
||
theunrepentantgeek marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` bash | ||
az rest --method delete --url https://management.azure.com/subscriptions/{subscription}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{service-name}?api-version=2021-08-01 | ||
``` | ||
|
||
## Troubleshooting | ||
|
||
If APIM are having an outage, or their API doesn't work for whatever reason, you may find you simply need to wait 48h+ for the soft-delete to turn into a hard-delete. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this net new? If so, why not as of Feb 2025?