0

We were trying to do a post query from an Azure function net core 3.1. We have the format for cURL

curl -i -k --cert ${PATH-TO-YOUR-CERT} --key ${PATH-TO-YOUR-KEY} https://example.com/v0/api -X POST -d '{"field1": "data1", "field2": "data2"}'

But we don't know how to do this operation from an Azure Function. We don't know how to use pem anf key nor how to get the certs into a function.

Is there a way to put it each cert on b64 into varaibles instead of upload the file?

How could it be the code to post with net core?

Thanks a lot!!

Julio
  • 94
  • 11

1 Answers1

1

Assuming this is a real production, you can use Azure Key Vault to store your key and retrieve it in your Azure Function.

https://learn.microsoft.com/en-us/azure/key-vault/about-keys-secrets-and-certificates

In order to retrieve it, you can use Key Vault References:

https://learn.microsoft.com/en-us/azure/app-service/app-service-key-vault-references

https://learn.microsoft.com/en-us/azure/app-service/app-service-key-vault-references

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90