How to check result of Resource Removal Operation for Azure Resource - azure

Using Resource Management API I can remove Azure resource (https://learn.microsoft.com/en-us/rest/api/resources/resources#Resources_DeleteById). This API returns 202 that removal is accepted - the resource is not removed right away though. The response header in my case contains "x-ms-request-id" value. How can I use it to get the status of this operation? Did the operation succeed? In my case I am removing the Log Analytics Solution resource.
Any help is greatly appreciated.

According to your description, I have checked this issue. I assumed that azure would take some time to handle your request, you could leverage Azure resource Get By Id to check your azure resource as follows:
For a simple way, you could leverage resources.azure.com, choose your resource and check the details. I removed my Log Analytics, then I could retrieve the following result:
UPDATE
According to your latest comment, I have checked the REST API again and both tested the operations on ASM and ARM, you could refer to them as follows:
For classic Azure Services (ASM)
You could use Get Operation Status with authentication using a management certificate to check the operation status.
For ARM
You could follow this tutorial about tracking asynchronous Azure operations. You could use the header values returned by the asynchronous REST operations, then request the related URL with authentication using Azure Active Directory to determine the status of your operation.
Based on your azure service, you need to use the ARM approach.

Related

Unable to move Cloud Service (Extended Support) to another resource group

we have problem to move Cloud Service (Extended Support) from 1 resource group to another resource group in the same subscription. Both resource groups are in the same location.
Picture with status of the move validation
Error code in validation window is:
{ "code": "ResourceMoveNotSupported", "target": "/subscriptions/123456-xxxx-yyyy-zzzz-123456/resourceGroups/AAAAA-BBBBB-Migrated/providers/Microsoft.Compute/cloudServices/AAAAA-BBBBB",
"message": "Resource move is not supported for resource types
'Microsoft.Compute/cloudServices'." }
Additional information:
Source resource group was created automatically after successful in-place migration from Cloud Service (Classic) to Cloud Service (Extended Support). Now we need to move all resources created by migration back to the original resource group, where Cloud Service (Classic) was previously located. Cloud Service (Classic) was automatically deleted after migration.
The main reason why we migrated from Cloud Service (Classic) to Cloud Service (Extended Support) was ability to move between subscriptions, but we are unable to move it even inside the same subscription :(
Any ideas how to proceed with this problem?
Best course of action is to create an Azure Support Ticket.
These type of operations are deep internal to azure, and reasons why these fail range from config errors, failed internal transactions to straight up bugs for a scenario they did not consider.
Note: it might take some time and patience on your side to get the desired results reached from Azure support, as these type of tickets are usually low priority.
We finally managed to contact Azure Support.
This move is not supported :(
Since the Cloud Service extended support is a new published product,
we are sorry that currently it does not support migration from one
subscription to another. We are sorry that moving “Cloud Service
extended support” among resource groups in the same subscription is
also unsupported.

Update Azure APIM Operation Name After Creation

Is it possible to change the operation name (a.k.a. operationId) of an Azure APIM operation after it has been created?
In the example below, I would like the auto-generated name of 5dk6e437e1fd991b3df455ff to be get-branding-information:
Changing the name is not currently supported through the Azure portal UI, but perhaps it is possible through another method? Since this URL only relates to the APIM documentation pages and is not the actual API URL, changing the name wouldn't be a breaking API change for our customers.
Developers who created the original operations on my team got a little lazy and just let the Azure portal assign an auto-generated name to multiple operations. As a result, I cannot create relative URL reference to different operations within the APIM documentation as the name value is unique in our development, QA, and production APIM environments.
Your screenshot didn't go quite high enough to show the 'OpenAPI specification View' button. Click this and you can edit the name.

Throttling issue while listing Azure Storage Accounts

I am using Azure JAVA SDK and am trying to list the Storage Accounts for the subscription. But I am intermittently getting this exception response.
com.microsoft.azure.CloudException: Status code 429,
{"error":{"code":"ResourceCollectionRequestsThrottled","message":"Operation
'Microsoft.Storage/storageAccounts/read' failed as server encountered
too many requests. Please try after '17' seconds. Tracking Id is
'f13c3318-8fb3-4ae1-85a5-975f4c17a512'."}}
Is there a limit on the number of requests one can make to the Azure resource API ?
Is there a limit on the number of requests one can make to the Azure
resource API ?
Yes. The limits are documented here: https://learn.microsoft.com/en-us/azure/azure-subscription-service-limits (please see Subscription limits - Azure Resource Manager section). And you can see the 429 error code from here.
Based on the documentation, currently you're allowed to make 15000 Read requests/hour for Azure Resource Manager API.

Azure ARM API - optimistic concurrency

Through the ARM REST API, I want to read a resource (an NSG) modify it and then write it back. I want the last step (writing it back) to fail if something came along and modified the resource in between my read and my write operation. Is that possible? I see there is an ETAG property when I do a GET, perhaps there is some way to utilize it to make the write fail if the resource is modified?
As I known, Azure Table Storage has the ETag in ITableEntity which is used for optimistic concurrency during updates. While the Azure REST API Network Security Groups about etag:
A unique read-only string that changes whenever the resource is updated.
I have tried to leverage Azure Portal and resources.azure.com to simulate the concurrent update operations on my NSG, and I found that there is no concurrency control on the update operation, the configurations would be overrided by the later request.
Per my understanding, there is no build-in feature for you to handle optimistic concurrency. For NSG, I assumed that you would not frequently modify it. So, I think you could try to limit the permission for a few people to update your NSG, or you could build your custom REST API for updating NSG, and get the latest NSG info, then compare the etag with your prior etag to determine that whether the NSG is modified before you update it. Also, you could add your feedback here.

Microsoft Azure how to get a list of locations from the REST ARM API?

Does Azure ARM REST API provide a way to get a list of available regions?
I can see that the classic REST API provides such a list as described here:
https://msdn.microsoft.com/en-us/library/azure/gg441293.aspx
But I can't see its equivalent for ARM.
To list the locations for an Azure Subscription using ARM API, please see this link: https://msdn.microsoft.com/en-us/library/azure/dn790540.aspx.
However please keep in mind that not all resources are available in all locations. If you want to find out the locations where a particular resource type is available, you would need to fetch information about the provider of that resource type. For this, please see this link: https://msdn.microsoft.com/en-us/library/azure/dn790524.aspx

Resources