Azure / Azure/azure-quickstart-templates
Getting classic storage quotas fails with ForbiddenError in oms-azure-storage-analytics-solution
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
When the "oms-azure-storage-analytics-solution" is deployed it has a scheduled runbook "AzureSAIngestionMetrics-MS-Mgmt-SA".
The script fails with the error:
`The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: ForbiddenError: The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.`.
The error occurs on the following request:
`$uri="https://management.core.windows.net/$subscriptionId"
$qresp=Invoke-WebRequest -Uri $uri -Method GET -Headers $headerasm -UseBasicParsing -Certificate $AzureCert`
It seems, that the reason is that the subscription was created after a moment when switching from classic storages occured and it doesn't support old API by default.
It would be better to handle the case gracefully and not fail "just because". Like check some flags pointing out the situation and don't try to get the info, use some predefined values instead.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the AzureSAIngestionMetrics-MS-Mgmt-SA scheduled runbook in the oms-azure-storage-analytics-solution and inspect the Invoke-WebRequest call to management.core.windows.net using the certificate. Determine how unsupported classic storage subscriptions should be identified, then verify that the runbook handles ForbiddenError without failing and uses the requested predefined values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100