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

Running PowerShell on Windows VM via a Webserver using Python SDK, authenticated as a specific user #11224

Closed
philippemnoel opened this issue Apr 22, 2020 · 6 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@philippemnoel
Copy link

I am currently running PowerShell on an Azure VM using the Python SDK. The python script gets run by a webserver. However, currently, I am running it without being authenticated as a user, which prevents me from running certain user-space scripts.

How can I run powershell from the azure Python SDK, but authenticated as a specific user?

Thank you for your help!

Philippe

@lmazuel lmazuel transferred this issue from Azure/msrest-for-python May 4, 2020
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 4, 2020
@lmazuel lmazuel added the Mgmt This issue is related to a management-plane library. label May 4, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label May 4, 2020
@lmazuel
Copy link
Member

lmazuel commented May 4, 2020

It's a complex question, the easiest would be to use managed identities:
https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview

Would that fit your need?

@philippemnoel
Copy link
Author

Thanks for replying -- I don't think that's what I want. I'm looking for something I can either run directly from the SDK, or via windows powershell directly from a windows client.

@RodgeFu
Copy link
Member

RodgeFu commented May 6, 2020

How about using windows task scheduler? you can configure a windows schedule task and configure a credential there. thx

@philippemnoel
Copy link
Author

I don't think that will work, I need to be able to call the script programmatically.

@RodgeFu
Copy link
Member

RodgeFu commented May 9, 2020

i mean pre-create the scheduled task in windows with the account, and then trigger the scheduled task programmatically which will in-turn trigger your script in scheduled task with the account you need.
https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/start-scheduledtask?view=winserver2012r2-ps&redirectedfrom=MSDN

@philippemnoel
Copy link
Author

Oh interesting -- I'll take a look, thanks!

openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this issue Nov 17, 2020
Add WVD Scaling Plan resource definitions (Azure#11224)

Co-authored-by: Jeremy Hurren <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

4 participants