Was BlobEncryptionPolicy removed for azure storage? - azure

I'm trying to use client side encryption for azure to securely upload files to blob storage in .NET,
However it seems that BlobEncryptionPolicy is not available and I have not seen any documentation specifying alternative solutions from microsoft.
Even their documentation still uses BlobEncryptionPolicy:
Client-Side Encryption and Azure Key Vault for Microsoft Azure Storage
Specifically i'm inside of a xamarin project using the latest .net version.
If i create a sample console app, I can reference BlobEncryptionPolicy without any issues. However the same nuget package inside a xamarin shared project can not resolve the reference to BlobEncryptionPolicy under the Microsoft.WindowsAzure.Storage.Blob namespace.
Does anyone know what is going on here?

There are some differences between Microsoft.WindowsAzure.Storage package depending on .net core and the one depending on .net framework.
You may have developed your Xamarin project based on .net core, where BlobEncryptionPolicy is not supported(this method doesn't exist in the dll).
As when you create a console app(.net framework), you can use the encryption. If you build a console app(.net core), you will find no such method as well.
An open issue on github about this, saying the encryption for .net core is coming soon.
You can change your targetframework to use it if .net core is not necessary for your development.

Related

Can I use Azure Functions V3 Azure static web API

When creating an Azure Static Site using the Blazor settings, you get an option to configure an API. My repository has an Azure Functions V3 API, and I want to use that. After making all the definitions, the build and deploy workflow fails. When I eliminate the api_location setting, the workflow succeeds.
I am pretty sure that the workflow expects a V2 Azure Functions application.
Can I supply a custom build command to build the V3 application?
Will role management work OK with V3?
Thanks!
According to this, a managed API can only use .NET Core 3.1, while V3 is .Net 5 based, so that is probably why the build failed.
Having said that, this document is from May 2020, so this maybe changing soon, hopefully...
Update: After discussing the matter with a Microsoft employee involved with the matter, they informed me that (a) the document is indeed up to date and (b) static apps API will .NET 6 support sometime in November...

Failed to install Microsoft.Azure.Mobile.Server.Authentication into Xamarin Forms

I'm trying to add / install Microsoft.Azure.Mobile.Server.Authentication into my PCL project but there is an error says
Could not install package 'Microsoft.Azure.Mobile.Server 2.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile49', but the package does not contain any assembly references or content files that are compatible with that framework.
I've tried installing the previous version, but the exact same error appeared. I've also tried to changing Framework version to .NET 4.6, but other errors come up.
I want to use GetAppServiceIdentityAsync() method which only supported by that namespace. Is there any other way to add that reference into my PCL project?
As I known, GetAppServiceIdentityAsync is used to retrieve the Identity (ProviderCredentials) for the specific provider in your server-side code. For your mobile client, I assumed that you could leverage MobileServiceClient.InvokeApiAsync<List<AppServiceIdentity>>("/.auth/me"); to retrieve the identities and filter them with the specific provider, them you could get Provider, UserId and UserClaims properties as you expected. For more details, you could refer to Obtaining User Claims.
Azure Mobile Apps has two versions - one that runs on the server and the other runs on the client. You are trying to use the server version and that requires ASP.NET and .NET Framework 4.5+ (4.6 at the moment). It won't work in your client.
If you are using Azure Mobile Apps on the server, then you have already added a referenced to Microsoft.Azure.Mobile.Client and created a mobile client reference to your Azure App Service. You have also already configured your Azure Mobile Apps Server and linked your auth provider using Azure App Service Authentication. If you haven't, check out the book http://aka.ms/zumobook - this will give you the right instruction on this.
If you are still with me, you then need to do a HTTPS connection to your Azure App Service URL + /.auth/me - this returns a JSON blob which contains the provider information that Azure App Service Authentication knows about. One of the things that the service knows about is the auth token used to authenticate. You can then use this auth token to get additional information about the user if it isn't in the JSON blob.
A great way to get that information is to use the client.InvokeApiAsync<>() method as Bruce mentioned. This is covered in the book as well.
Have you tried to set the Android API Level to a higher level? I had this error by installing Moq and I could solve this problem with changing the Android API Level to the highest API level. Please try to use Android 7.1 (Nougat) with API-Level 25, also at the minimum SDK.
You can change it with: Right click on the project -> Options -> Build -> General -> Android Application
Under General you can also try to change the target version for the app to a higher level.

Azure Service Bus DNX Core support

UPDATE: DNX does not exist anymore. Please ignore this question.
Current WindowsAzure.ServiceBus (3.0.4) nuget package (http://nuget-preprod-0-v2gallery.cloudapp.net/packages/WindowsAzure.ServiceBus/) requires .NET Framework 4.5 Full Profile and it is not usable with an application build specifically to use DNX Core.
As I understand, the only way to build such application at this moment is to use REST API.
What is the recommended way to include authentication information to requests? Do we have any open source nuget to handle it or should the SAS token creation be implemented by each developer? Links to the REST API authentication samples are broken.
While the Service Bus nuget package is not open sourced, do we have any active channels to reach the developers to find out if they have any plans to support DNX Core and we should not use REST API because the library update is coming soon?
The REST URL to publish a message on Queue/Topic will be like,
http{s}://{serviceNamespace}.servicebus.windows.net/{queuePath|topicPath}/messages
The authorization SAS Token has to be part of the request header
For further read, REST Run-Time APIs
It's also possible by using the AMQP protocol. I recently used AMQP to communicate with an Azure IoTHubClient, all in a DNXCore5.0 project. I used the AMQPNetLite Library to do so, it also has Service Bus Examples!
(Reposting as my prior answer was erroneously deleted by the moderators.)
Microsoft now provides a .NET core version of this library. I am shipping a .NET Core app on Linux that calls it.
https://github.com/azure/azure-service-bus-dotnet
Announcement post:
https://blogs.msdn.microsoft.com/servicebus/2016/12/20/service-bus-net-standard-and-open-source/

Use azure media service / server with xamarin

Have anyone used azure media service with xamarin. I am trying to make an portable library which can upload / retrieves video asseset from a standard azure media server. However I am not able to install the nuget package into my project.
Can anyone point me in the right direction
I don't think the default azure media libary is a portable library therefore you cannot add it to your portable library project.
You could however implement this using the available rest documentation.
Media Services Rest Api
We've done something similar for access to blob storage. To avoid having to reference all the azure storage libraries in all our projects.

Monotouch - Windows Azure toolkit

I am working on an Iphone application which needs a direct access to Azure. I know there are toolkit versions exist for Objective C and Android. Is there any ported version of the toolkit exists for Monotouch?
There is no specific Azure SDK which is designed for MonoTouch and the Azure desktop binary are not compatible. If you decide to use MonoTouch, you would need to use WebClient API to create your own HTTP/HTTPS connection something similar to as described here, which could be comparative complex. On internet you may find some experiment level code to use Azure services and MonoTouch application so you may be by your own to try to get things working.
If you choose Objective C then you can use iOS SDK for Windows Azure which is far better solution. I personally will not use MonoTouch to develop application on iOS devices, if I am heavily dependent on Windows Azure Services, instead I will choose iOS Windows Azure SDK to connect Azure Service through native code.
Check this out as well: MonoTouch connect to Azure ACS, Azure SQL / Azure WCF

Resources