-
Notifications
You must be signed in to change notification settings - Fork 44
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
Support for ManagedIdentity #71
Comments
Have a suggested solution available for you. @@ -1,5 +1,6 @@
import {
AnonymousCredential,
+ ManagedIdentityCredential,
BlobServiceClient,
newPipeline,
StorageSharedKeyCredential,
@@ -14,6 +15,7 @@ type Config = {
containerName: string;
defaultPath: string;
cdnBaseURL?: string;
+ managedIdentity?: boolean;
};
type StrapiFile = File & {
@@ -44,12 +46,18 @@ function makeBlobServiceClient(config: Config) {
const account = trimParam(config.account);
const accountKey = trimParam(config.accountKey);
const sasToken = trimParam(config.sasToken);
+ const managedIdentity = config.managedIdentity;
const serviceBaseURL = getServiceBaseUrl(config);
- // if accountKey doesn't contain value return below line
+ // if sasToken contains value return below line
if (sasToken != '') {
const anonymousCredential = new AnonymousCredential();
return new BlobServiceClient(`${serviceBaseURL}${sasToken}`, anonymousCredential);
}
+ // if managedIdentity is true return below line
+ if (managedIdentity) {
+ const aadCredentials = new ManagedIdentityCredential();
+ return new BlobServiceClient(serviceBaseURL, aadCredentials);
+ }
const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
const pipeline = newPipeline(sharedKeyCredential);
return new BlobServiceClient(serviceBaseURL, pipeline);
|
Hello @mbfaay, I'm okay supporting other connection types. Would you like to issue a PR? |
Hi @jakeFeldman, I can issue a PR for supporting managed identity. |
Gentle reminder |
Hey @mbfaay thanks for the reminder. You should be able to fork the repo and open a PR from your fork. Let me know if you have any issues doing so. |
@jakeFeldman I see that #72 has been approved. Is this still on the roadmap? I would love to start using this feature. |
@jakeFeldman This would be awesome to have. Is there anything needed beside the open #72 to get this working? |
@jakeFeldman thank you for responding so quickly. |
Can be closed now? |
It would be nice to have support for ManagedIdentityCredential.
e.g. for case where Strapi is running in Azure App Service and media is stored in Azure Storage Account with shared keys disabled.
The text was updated successfully, but these errors were encountered: