Skip to content
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

The subscription 'Sub id' could not be found." #5

Closed
nhoj01 opened this issue Mar 12, 2021 · 8 comments
Closed

The subscription 'Sub id' could not be found." #5

nhoj01 opened this issue Mar 12, 2021 · 8 comments
Assignees

Comments

@nhoj01
Copy link

nhoj01 commented Mar 12, 2021

Hello:

I am trying to use the function app in Azure Gov using the payload below, and I keep getting an error that the subscription is not found. Is this not usable on Azure Government?

{
"Action": "start",
"EnableClassic": false,
"RequestScopes": {
"ExcludedVMLists": [],
"Subscriptions": [
"/subscriptions/my-subscription-id/"
]
}
}

"StackTrace": " at Microsoft.Azure.Management.ResourceManager.Fluent.ResourcesOperations.ListWithHttpMessagesAsync(ODataQuery1 odataQuery, Dictionary2 customHeaders, CancellationToken cancellationToken)\r\n at Microsoft.Azure.Management.ResourceManager.Fluent.ResourcesOperationsExtensions.ListAsync(IResourcesOperations operations, ODataQuery1 odataQuery, CancellationToken cancellationToken)\r\n at StartStopAzureFunctions.Clients.AzureVirtualMachineClient.GetSubscriptionArmVirtualMachinesAsync(String subscriptionId) in D:\\a\\1\\s\\StartStopAzureFunctions\\Clients\\AzureVirtualMachineClient.cs:line 110\r\n at StartStopAzureFunctions.Clients.AzureVirtualMachineClient.GetSubscriptionVirtualMachinesAsync(String subscriptionId) in D:\\a\\1\\s\\StartStopAzureFunctions\\Clients\\AzureVirtualMachineClient.cs:line 98\r\n at StartStopAzureFunctions.BusinessLogic.UserRequestTranslatorBL.GetAccessibleVmsForSubscriptionScopesAsync(IEnumerable1 subscriptionIds) in D:\a\1\s\StartStopAzureFunctions\BusinessLogic\UserRequestTranslatorBL.cs:line 82\r\n at StartStopAzureFunctions.Workflows.VirtualMachineScheduledRequestWorkflow.StartWorkflowAsync(ScheduledRequest scheduledRequest) in D:\a\1\s\StartStopAzureFunctions\Workflows\VirtualMachineScheduledRequestWorkflow.cs:line 81\r\n at StartStopAzureFunctions.ScheduledRequestFunction.RunAsync(ScheduledRequest scheduledRequest, CloudQueue orchestrationRequestQueue, CloudTable requestStoreTable) in D:\a\1\s\StartStopAzureFunctions\ScheduledRequestFunction.cs:line 41"
}

@svarga-msft
Copy link
Contributor

Hi, the solution does support Azure Government subscriptions. Did you deploy using the deployment button for government subscriptions?

I'd be happy to help you get this sorted out.

@svarga-msft
Copy link
Contributor

I see you provided the stack trace, but could you provide the exact error that you received? There are a variety of subscription related error messages so the exact one will help us narrow it down.

@nhoj01
Copy link
Author

nhoj01 commented Mar 12, 2021

@svarga-msft I deployed using the Production - Fairfax/UsGov (Preview)

I'm a bit new at Azure Functions/Logic apps is there a specific error code that you need and how would I find it?

The logic app is showing status 500
{
"Message": "An error has occurred.",
"ExceptionMessage": "The subscription 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' could not be found.",

@svarga-msft
Copy link
Contributor

Just to confirm, the subscription that you deployed to is the same subscription that you're using in the payload?

@nhoj01
Copy link
Author

nhoj01 commented Mar 12, 2021

Correct it is the same subscription.

@svarga-msft
Copy link
Contributor

The solution uses logic apps to call an Azure Function. From the stack trace it looks like the function is failing on the call to pull the Virtual Machines in the provided subscription.

Please feel free to send our team an email here: startstopv2team@microsoft.com

We can hopefully work with you to get it sorted out, then update this thread for future users.

@balas77
Copy link
Contributor

balas77 commented Mar 15, 2021

We found the root cause of this issue and sorry for the inconvenience caused.

Please follow the below instructions to make quick update in the function app configuration (this is to make sure you can reuse the same deployment).

Open the azure portal and navigate to the resource group that you had our V2 deployment.
• Open the function app  Configuration (under Settings)
• Do the below changes to the configuration properties
o Click & Change the property name from AzureClientOptions:AzureEnvironment to AzureClientOptions:AzureEnv
o Click the StorageOptions:StorageAccountConnectionString property name and append the value at the end. Please make
sure keep the existing value as is and only append the new value at the end.

o ;EndpointSuffix=core.usgovcloudapi.net

We have also fixed this and updated the package in the GitHub which you can also deploy the new instance if needed!

@balas77
Copy link
Contributor

balas77 commented Apr 26, 2021

I hope this is resolved now and hence closing this issue!

@balas77 balas77 closed this as completed Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants