pulumi / pulumi-azure-native

Azure Native Provider
Apache License 2.0
129 stars 35 forks source link

Create Azure Storage Blob with `--auth-mode login` #2948

Open hisuwh opened 11 months ago

hisuwh commented 11 months ago

Hello!

Issue details

We have disabled Key based authentication on our storage accounts as a security measure. Our services authenticate through a Service Principal.

I can upload a blob through the Azure cli by setting --auth-mode login:

$ az storage blob upload --file path/to/file.html --container-name mycontainer --name file.htm --account-name myaccount --auth-mode login
Finished[#############################################################]  100.0000%

The Pulumi Azure Native API for creating blobs does not seem to expose this as a parameter and it would seem it is trying to use Key based authentication as I'm getting a 403 on trying to create Blobs with pulumi.

Affected area/feature

https://www.pulumi.com/registry/packages/azure-native/api-docs/storage/blob/

mjeffryes commented 11 months ago

Thanks for reporting this @hisuwh.

hisuwh commented 11 months ago

@mjeffryes no problem. I assume you're not aware of any workarounds?

MatteoCalabro-TomTom commented 10 months ago

Hello @hisuwh, have you tried setting AZURE_STORAGE_AUTH_MODE=login environment variable? Pulumi might not expose a setting for it, but the Azure MSAL library should honor the setting.

hisuwh commented 10 months ago

@MatteoCalabro-TomTom thanks I might try that. Any idea how I can set this in a way that doesn't require thinking about again? Otherwise defeats the point of IAC

hisuwh commented 10 months ago

@MatteoCalabro-TomTom that didn't work

i-scott commented 5 days ago

Did you find a solution for this, have encountered something different in that it enables Entra, but now I have a CORS issue trying to get to the blob container